<template>
  <div style="background-color: #F8F8F8;min-height: 100vh;">
    <div class="new-detail-wrap">
      <!-- <div class="new-detail-head-img" :style="bgImg"></div> -->
      <div style="width: 100%;text-align: center;">
        <img style="width: 100%;height: 400px;" :src="`http://123.56.85.94:2020/${searchdetail.picture_url}`" />
      </div>
      <div class="text-inner">
        <!-- <img :src="`http://123.56.85.94:2020/${searchdetail.picture_url}`" /> -->
        <h3>{{searchdetail.title_name}}</h3>
        <span>所属科室：{{ searchdetail.dep_name }}&nbsp&nbsp&nbsp 文章简介：{{ searchdetail.resume }}</span>
        <div style="color: #333333;" v-html="searchdetail.main_body">{{searchdetail.main_body}}</div>
        <div style="text-align: right;color: #333333;">{{searchdetail.create_time.slice(0,10)}}</div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    getAction
  } from '@/api/manage'

  export default {
    //这是主页
    name: 'MedicalGraphicsLibrary',
    data() {
      return {
        searchdetail: [],
        getSearchPublicList: '/es/searchFull/getSearchPublicList',
        isOpenAll: false, //记录是否所有的都处于打开/关闭状态
        openShowText: "全部展开", //记录按钮文字
        menuVisible: false,
        searchType: 0,
        bgImg: {},
      }
    },

    created() {
      this.everyId = this.$route.query.id;
      this.searchType = this.$route.query.type;
      getAction(this.getSearchPublicList, {
        searchName: this.everyId,
        searchType: this.searchType
      }).then(res => {
        console.log("============="+JSON.stringify(res));
        if (res.success) {
          this.searchdetail = res.result.recordList[0];
          this.bgImg = {'background-image': `url(http://123.56.85.94:2020/${res.result.recordList[0].picture_url})`};
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    methods: {
     
    }
  }
</script>

<style lang="scss" scoped>

  .new-detail-wrap{
    width: 83.33%;
    margin: 0px auto;
    
    box-sizing: border-box;
    background-color: #FFFFFF;
    .new-detail-head-img{
      width:100%;
      height: 400px;
      background-size: cover;
      background-repeat:no-repeat;
    }
    .text-inner{
      padding: 10px 20px 30px 20px;
      box-sizing: border-box;
      img{
        width: 100%;
        border-radius: 3px;
      }
      span{
        width: 100%;
        display: block;
        margin-bottom: 20px;
        text-align: center;
      }
      h3{
        width: 100%;
        text-align: center;
        font-size: 1.5em;
      }
    }
  }
</style>
